-------------------------------------------------------------------------------
Sample Name: School

Description: An MDI application to manage students, classes, and so forth. 
             With its 30 forms and 3 modules, this is more similar to the 
             actual business applications you may need to convert to .NET than 
             most other samples in this page. 
             (We would like to offer more examples like this, but few of them 
             are open source.) 

Download URL: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=52497&lngWId=1
-------------------------------------------------------------------------------

IMPORTANT NOTE
The first step to ensure that you can migrate the VB6 project to VB.NET is 
loading the original project in the Visual Basic 6 IDE, run it to ensure that 
it works fine, that all the required type libraries are installed, and that all 
file paths are correct. 
Regardless of whether you edited the source code in any way, you should save 
the VB6 project: this save operation ensures that the .vbp file includes  
the correct path and version of referenced type libraries. 
After saving the project, it's usually a good idea to compile the VB6 project
to an executable, to detect any VB6 compilation errors that would appear under 
VB.NET as well. 
(If you don't recompile the project VB Migration Partner will display a warning 
when you later load the project.)


The application uses two data files, thus you need two AddDataFile pragmas to 
ensure that these files are added to the VB.NET solution. You can add these
pragmas at the top of the MDIForm1.frm file:

'## AddDataFile MASTERFILE.MDB
'## AddDataFile SETTINGS\*.*

VB Migration Partner doesn't support the DataReport designer, thus the migrated
application can't compile because of a few compilation errors. You can avoid
these errors by using a pragma that comments out all the lines of code
thate reference one of the DataReport objects. You can add these pragma at the top 
of the MDIForm1 file:

'## project:PostProcess "(?<=\n[ \t]*[^']).*DataReport[1-6]", "' UNSUPPORTED: $0"

Refer to the manual for more information about this powerful pragma. 

In Form1.frm you also need to add the following ReplaceStatement pragma in order
to handle correctly the check on current field of integers:

Private Sub Command3_Click()
    If rs_stud.RecordCount < 1 Then MsgBox "No student in the list.Please check it!", vbExclamation, "CSRS version 1": Exit Sub

    '## ReplaceStatement If Not IsNull6(rs_stud.Fields(10).Value) Then
    If Not rs_stud.Fields(10) = "" Then
        ....

End Sub

Besides, to avoid null reference exceptions on some recordsets, which are set to
Nothing after closing a form in VB6, you can add this pragma at the top of the
Module2.bas

'## AutoNew True

VB Migration Partner typically delivers many warnings that are related to 
code analysis as well as suggestions about how you can improve the original 
VB6 code before converting it to VB.NET. 
You can suppress these warnings by adding the following project-level pragmas 
at the top of any of the file that make up the project:

'##project:DisableMessage 0501
'##project:DisableMessage 0551
